qui {
use "$datapath/003_cluster_fullsample_cog.dta", clear	
gen bunch = (hours==0)
egen mh = median(hours), by(X_50)
tempfile temp
save `temp', replace
collapse (p50) hours (mean) bunch (p25) p25=hours (p75) p75=hours , by(X_50)
sort hours p75
gen id=_n
/*
twoway (scatter hours id [w=bunch], msymbol(circle_hollow) xtitle(Cluster) ytitle(L) legend(off)) || (scatter p75 id, msymbol(circle) mcolor(black) xtitle(Cluster) ytitle(L) legend(off)), scheme(s1mono)
*/
twoway (scatter hours id, msymbol(circle_hollow) xtitle(Cluster) ytitle(L) legend(off)) || (rcap p25 p75 id if id==1 | id==25 | id==50 | id==75 | id==100, sort color(grey%50)), scheme(s1mono) ylabel(0(500)2500)

//twoway (scatter hours id, msymbol(circle_hollow) xtitle(Cluster) ytitle(L) legend(off) ylabel(0(500)2500)), scheme(s1mono)
graph export "$figpath/ClusterRank.pdf", replace
}
